﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KinSocket;

namespace KinConquer.Packets.Structures
{
    public class ConquerTime
    {
        public Byte[] mData { get; private set; }
        public static explicit operator Byte[](ConquerTime d) { return d.mData; }

        public ConquerTime()
        {
            DateTime time = DateTime.Now;

            this.mData = new Byte[36];
            PacketConstructor.Write((UInt16)this.mData.Length, 0, mData);
            PacketConstructor.Write((UInt16)1033, 2, mData);
            PacketConstructor.Write((UInt32)(time.Year - 1900), 8, mData);
            PacketConstructor.Write((UInt32)(time.Month - 1), 12, mData);
            PacketConstructor.Write((UInt32)(time.DayOfYear), 16, mData);
            PacketConstructor.Write((UInt32)(time.Day), 20, mData);
            PacketConstructor.Write((UInt32)(time.Hour), 24, mData);
            PacketConstructor.Write((UInt32)(time.Minute), 28, mData);
            PacketConstructor.Write((UInt32)(time.Second), 32, mData);
        }
    }
}
